/**
 * Copyright (C) 2008 Christopher Allen Ogden
 *
 *     This file is part of Odysi.
 *
 *  Odysi is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  Odysi is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with Odysi.  If not, see <http://www.gnu.org/licenses/>.
 */

#pragma once
#include <lua.hpp>
#include <lauxlib.h>
#include "genPackets.h"

#define LUA_CR_POST_SERVICE "odysic.PostService"
#define LUA_CR_MAP "odysic.Map"

/**
 * Open the Lua client library.
 *
 * @param L The Lua state.
 * @return  1 on success.
 */
int openOdysicLib(lua_State *L);

/**
 * Call the tick function.
 *
 * @param L The lua state.
 */
void call_tick(lua_State *L);

/**
 * Call the gotLoginOKPacket function.
 *
 * @param L The lua state.
 */
void call_gotLoginOKPacket(lua_State *L);

/**
 * Call the gotLoginFailPacket function.
 *
 * @param L The lua state.
 */
void call_gotLoginFailPacket(lua_State *L);

/**
 * Call the gotAddCharacterPacket function.
 *
 * @param L     Lua state.
 * @param ac    Add character struct.
 */
void call_gotAddCharacterPacket(lua_State *L, const genPacket::AddCharacterPacket *ac);

/**
 * Call the moveRequest function.
 *
 * @param L     Lua state.
 * @param dir   Direction to move.
 */
void call_moveRequest(lua_State *L, int dir);

/**
 * Call the gotMoveObjectPacket function.
 *
 * @param L     Lua state.
 * @param mp    Move packet.
 */
void call_gotMoveObjectPacket(lua_State *L, const genPacket::MoveObjectPacket *mp);
